<?
header("content-type: text/xml");
$sessionID = $_GET['sessionID'];
$lat = $_GET['lat'];
$lon = $_GET['lon'];
$chapter = $_GET['chapter'];
$city = $_GET['city'];
$street = $_GET['street'];
$pub = $_GET['pub'];
$cafe = $_GET['cafe'];
$restaurant = $_GET['restaurant'];
$train = $_GET['train'];
$weather = $_GET['weather'];
$page = $_GET['page'];


$username="eu_wilhelm";
$password="n3DN67xcDwPyba4S";
$database="eu_wilhelm";


mysql_connect("gis-db.uni-muenster.de",$username,$password) or die("Connection failed: ". mysql_error());

@mysql_select_db($database) or die( "Unable to select database: ". mysql_error());

//$query="CREATE TABLE lbst(id int auto_increment, PRIMARY KEY(id),sessionID DOUBLE, lat DOUBLE, lon DOUBLE, city VARCHAR(25), street VARCHAR(25), pub VARCHAR(25), cafe VARCHAR(25), restaurant VARCHAR(25), weather VARCHAR(25), train VARCHAR(25), chapter int(3), page int(3), created TIMESTAMP DEFAULT NOW());";
//$query = "drop table lbst;";

$query = "INSERT INTO lbst (sessionID, lat, lon, chapter, city, street, pub, cafe, restaurant, train, weather, page) VALUES('$sessionID', '$lat', '$lon', '$chapter', '$city', '$street', '$pub', '$cafe', '$restaurant', '$train', '$weather', '$page');";
//$query = "INSERT INTO lbst (sessionID, lat, lon, chapter, contextVariables) VALUES('123', '3', '45', '1', 'jow');";

mysql_query($query) or die ("Query Error: " .mysql_error());
echo "Data inserted";

mysql_close();
 
?>